\hypertarget{classToken}{
\section{Token Class Reference}
\label{classToken}\index{Token@{Token}}
}


\hyperlink{classToken}{Token} object that is made up of a lexeme (string), a value (integer) and a Type.  




{\ttfamily \#include $<$token.h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classToken_aa3c5868ba4115f3189df6b2ac5b36f39}{Token} ()
\begin{DoxyCompactList}\small\item\em A base constructor for the \hyperlink{classToken}{Token} class. \item\end{DoxyCompactList}\item 
\hyperlink{classToken_a3d7d59eaac1535df1433357d5d372f84}{$\sim$Token} ()
\item 
\hyperlink{classToken_abe7d4640c0784e490bccaa254f11a8d9}{Token} (\hyperlink{token_8h_a1d1cfd8ffb84e947f82999c682b666a7}{Type}, int, string)
\begin{DoxyCompactList}\small\item\em A special \hyperlink{classToken}{Token} constructor, which we give it the \hyperlink{classToken}{Token} data immediately. \item\end{DoxyCompactList}\item 
const int \hyperlink{classToken_a9241d3f6b9174f79cdc74e824a3b8422}{getValue} () const 
\begin{DoxyCompactList}\small\item\em A set of accessors for returning the bare lexical data of the \hyperlink{classToken}{Token}. \item\end{DoxyCompactList}\item 
const \hyperlink{token_8h_a1d1cfd8ffb84e947f82999c682b666a7}{Type} \hyperlink{classToken_ab0fd5697b1b85d91ac491e687a2044f2}{getType} () const 
\item 
const string \hyperlink{classToken_af056820e37b409c87f7bb17ea8139a42}{getLexeme} () const 
\item 
void \hyperlink{classToken_a693d12716fcbf365e115dde0314ee306}{setType} (\hyperlink{token_8h_a1d1cfd8ffb84e947f82999c682b666a7}{Type})
\begin{DoxyCompactList}\small\item\em A set of modifiers to change the Token's atomic data types. \item\end{DoxyCompactList}\item 
void \hyperlink{classToken_ab015619f67bf97abb8d00a9037cafd49}{setValue} (int)
\item 
void \hyperlink{classToken_aed8a3626e2ef382587f66befa0f5761f}{setLexeme} (string)
\item 
string \hyperlink{classToken_a4e0ca338277bccb0f820f5149e82af79}{toString} ()
\begin{DoxyCompactList}\small\item\em Converts the \hyperlink{classToken}{Token} to a String in the form of $<$\_\-,\_\-,\_\-$>$ \item\end{DoxyCompactList}\item 
bool \hyperlink{classToken_afefbe9d487b40b055403fa2c41004d99}{operator==} (const \hyperlink{classToken}{Token} \&) const 
\begin{DoxyCompactList}\small\item\em Overloaded operators to allow easy comparison between two tokens. \item\end{DoxyCompactList}\item 
bool \hyperlink{classToken_a2f5a82fe3f636917336cc5171f4f53c2}{operator!=} (const \hyperlink{classToken}{Token} \&) const 
\begin{DoxyCompactList}\small\item\em Redefined Non-\/Equivalency Operator for a \hyperlink{classToken}{Token}. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{classToken_a041346a45c6c5571a78a6af3394a2756}{value}
\begin{DoxyCompactList}\small\item\em We put the core \hyperlink{classToken}{Token} values in a protected state in case we wish to subclass token. \item\end{DoxyCompactList}\item 
\hyperlink{token_8h_a1d1cfd8ffb84e947f82999c682b666a7}{Type} \hyperlink{classToken_a7e5e6513d379ca2e388273b23ea1ba4a}{type}
\item 
string \hyperlink{classToken_af4c57a4ede01f2040ea4927141f5a661}{lexeme}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{classToken}{Token} object that is made up of a lexeme (string), a value (integer) and a Type. The \hyperlink{classToken}{Token} is the Strong/multivalued base type that is used by our \hyperlink{classScanner}{Scanner}, \hyperlink{classParser}{Parser} and their communicable Symbol Table.

It provides accessors and mutators for the associated value types. The \hyperlink{classToken}{Token} itself is represented by a \char`\"{}$<$ token-\/type, token-\/value, token-\/lexeme $>$\char`\"{} format. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classToken_aa3c5868ba4115f3189df6b2ac5b36f39}{
\index{Token@{Token}!Token@{Token}}
\index{Token@{Token}!Token@{Token}}
\subsubsection[{Token}]{\setlength{\rightskip}{0pt plus 5cm}Token::Token ()}}
\label{classToken_aa3c5868ba4115f3189df6b2ac5b36f39}


A base constructor for the \hyperlink{classToken}{Token} class. 

The default constructor, which assigns basic null-\/like values to the token.

Destructor unspecified. \begin{DoxySeeAlso}{See also}
\hyperlink{classToken_aa3c5868ba4115f3189df6b2ac5b36f39}{Token::Token()} Definition.
\end{DoxySeeAlso}


References lexeme, type, UNKNOWN, and value.

\hypertarget{classToken_a3d7d59eaac1535df1433357d5d372f84}{
\index{Token@{Token}!$\sim$Token@{$\sim$Token}}
\index{$\sim$Token@{$\sim$Token}!Token@{Token}}
\subsubsection[{$\sim$Token}]{\setlength{\rightskip}{0pt plus 5cm}Token::$\sim$Token ()\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classToken_a3d7d59eaac1535df1433357d5d372f84}
\hypertarget{classToken_abe7d4640c0784e490bccaa254f11a8d9}{
\index{Token@{Token}!Token@{Token}}
\index{Token@{Token}!Token@{Token}}
\subsubsection[{Token}]{\setlength{\rightskip}{0pt plus 5cm}Token::Token ({\bf Type} {\em newType}, \/  int {\em newValue}, \/  string {\em newLexeme})}}
\label{classToken_abe7d4640c0784e490bccaa254f11a8d9}


A special \hyperlink{classToken}{Token} constructor, which we give it the \hyperlink{classToken}{Token} data immediately. 

Creates a \hyperlink{classToken}{Token} with a specified type, value and lexeme.

Used when reconstructing the tokens.

A \hyperlink{classToken}{Token} is constructed from the values given by the constructor parameters.


\begin{DoxyParams}{Parameters}
\item[{\em newType}]The given Type of token (if known). \item[{\em newValue}]The value of our lexeme (if any). \item[{\em newLexeme}]A string representing our Lexeme name. \end{DoxyParams}


References lexeme, type, and value.



\subsection{Member Function Documentation}
\hypertarget{classToken_af056820e37b409c87f7bb17ea8139a42}{
\index{Token@{Token}!getLexeme@{getLexeme}}
\index{getLexeme@{getLexeme}!Token@{Token}}
\subsubsection[{getLexeme}]{\setlength{\rightskip}{0pt plus 5cm}const string Token::getLexeme () const}}
\label{classToken_af056820e37b409c87f7bb17ea8139a42}


References lexeme.

\hypertarget{classToken_ab0fd5697b1b85d91ac491e687a2044f2}{
\index{Token@{Token}!getType@{getType}}
\index{getType@{getType}!Token@{Token}}
\subsubsection[{getType}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf Type} Token::getType () const}}
\label{classToken_ab0fd5697b1b85d91ac491e687a2044f2}


References type.

\hypertarget{classToken_a9241d3f6b9174f79cdc74e824a3b8422}{
\index{Token@{Token}!getValue@{getValue}}
\index{getValue@{getValue}!Token@{Token}}
\subsubsection[{getValue}]{\setlength{\rightskip}{0pt plus 5cm}const int Token::getValue () const}}
\label{classToken_a9241d3f6b9174f79cdc74e824a3b8422}


A set of accessors for returning the bare lexical data of the \hyperlink{classToken}{Token}. 

Return Functions give access to atomic \hyperlink{classToken}{Token} data to outside actors.

References value.

\hypertarget{classToken_a2f5a82fe3f636917336cc5171f4f53c2}{
\index{Token@{Token}!operator!=@{operator!=}}
\index{operator!=@{operator!=}!Token@{Token}}
\subsubsection[{operator!=}]{\setlength{\rightskip}{0pt plus 5cm}bool Token::operator!= (const {\bf Token} \& {\em temp}) const}}
\label{classToken_a2f5a82fe3f636917336cc5171f4f53c2}


Redefined Non-\/Equivalency Operator for a \hyperlink{classToken}{Token}. 

Returns the inverse of the equivalency operator.


\begin{DoxyParams}{Parameters}
\item[{\em temp}]A token reference that we compare this one to. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
a boolean indicating that it is equivalent (false) or not. 
\end{DoxyReturn}
\hypertarget{classToken_afefbe9d487b40b055403fa2c41004d99}{
\index{Token@{Token}!operator==@{operator==}}
\index{operator==@{operator==}!Token@{Token}}
\subsubsection[{operator==}]{\setlength{\rightskip}{0pt plus 5cm}bool Token::operator== (const {\bf Token} \& {\em first}) const}}
\label{classToken_afefbe9d487b40b055403fa2c41004d99}


Overloaded operators to allow easy comparison between two tokens. 

Redefined Equivalency Operator for a \hyperlink{classToken}{Token}.

Defines the equivalency operator as a comparison between the lexeme, the value and the type of this token and the one it is compared to.


\begin{DoxyParams}{Parameters}
\item[{\em first}]A token reference that we compare this one to. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
a boolean indicating that it is equivalent (true) or not. 
\end{DoxyReturn}


References getLexeme(), getType(), and getValue().

\hypertarget{classToken_aed8a3626e2ef382587f66befa0f5761f}{
\index{Token@{Token}!setLexeme@{setLexeme}}
\index{setLexeme@{setLexeme}!Token@{Token}}
\subsubsection[{setLexeme}]{\setlength{\rightskip}{0pt plus 5cm}void Token::setLexeme (string {\em newLexeme})}}
\label{classToken_aed8a3626e2ef382587f66befa0f5761f}


References lexeme.

\hypertarget{classToken_a693d12716fcbf365e115dde0314ee306}{
\index{Token@{Token}!setType@{setType}}
\index{setType@{setType}!Token@{Token}}
\subsubsection[{setType}]{\setlength{\rightskip}{0pt plus 5cm}void Token::setType ({\bf Type} {\em newType})}}
\label{classToken_a693d12716fcbf365e115dde0314ee306}


A set of modifiers to change the Token's atomic data types. 

A set of mutators allow us to alter our \hyperlink{classToken}{Token} data after construction.

References type.

\hypertarget{classToken_ab015619f67bf97abb8d00a9037cafd49}{
\index{Token@{Token}!setValue@{setValue}}
\index{setValue@{setValue}!Token@{Token}}
\subsubsection[{setValue}]{\setlength{\rightskip}{0pt plus 5cm}void Token::setValue (int {\em newValue})}}
\label{classToken_ab015619f67bf97abb8d00a9037cafd49}


References value.

\hypertarget{classToken_a4e0ca338277bccb0f820f5149e82af79}{
\index{Token@{Token}!toString@{toString}}
\index{toString@{toString}!Token@{Token}}
\subsubsection[{toString}]{\setlength{\rightskip}{0pt plus 5cm}string Token::toString ()}}
\label{classToken_a4e0ca338277bccb0f820f5149e82af79}


Converts the \hyperlink{classToken}{Token} to a String in the form of $<$\_\-,\_\-,\_\-$>$ 

Returns a string representation of a token.

\begin{DoxySeeAlso}{See also}
\hyperlink{classToken}{Token}\{\};.
\end{DoxySeeAlso}
\hyperlink{classToken}{Token} Data is transformed into a string of the format: \char`\"{}$<$ token-\/type, token-\/value, token-\/lexeme $>$\char`\"{} and returned as a string. \begin{DoxyReturn}{Returns}
string A string representing our token. 
\end{DoxyReturn}


References lexeme, spellOutTypeName(), type, and value.



\subsection{Member Data Documentation}
\hypertarget{classToken_af4c57a4ede01f2040ea4927141f5a661}{
\index{Token@{Token}!lexeme@{lexeme}}
\index{lexeme@{lexeme}!Token@{Token}}
\subsubsection[{lexeme}]{\setlength{\rightskip}{0pt plus 5cm}string {\bf Token::lexeme}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classToken_af4c57a4ede01f2040ea4927141f5a661}
\hypertarget{classToken_a7e5e6513d379ca2e388273b23ea1ba4a}{
\index{Token@{Token}!type@{type}}
\index{type@{type}!Token@{Token}}
\subsubsection[{type}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Type} {\bf Token::type}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classToken_a7e5e6513d379ca2e388273b23ea1ba4a}
\hypertarget{classToken_a041346a45c6c5571a78a6af3394a2756}{
\index{Token@{Token}!value@{value}}
\index{value@{value}!Token@{Token}}
\subsubsection[{value}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf Token::value}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classToken_a041346a45c6c5571a78a6af3394a2756}


We put the core \hyperlink{classToken}{Token} values in a protected state in case we wish to subclass token. 



The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
\hyperlink{token_8h}{token.h}\item 
\hyperlink{token_8cpp}{token.cpp}\end{DoxyCompactItemize}
